/**
 * Copyright 2016-2018 mobaas.com
 */
package com.mobaas.devops;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.mobaas.devops.interceptor.ManageInterceptor;

/**
 * 
 * author: billy zhang
 * 
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer{


	@Bean
	ManageInterceptor ManageInterceptor() {
		return new ManageInterceptor();
	}
	

    /**
     * 添加拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {


        registry.addInterceptor(ManageInterceptor())    //指定拦截器类
        			.addPathPatterns("/**")
        			.excludePathPatterns("/login", "/submitLogin", "/lib/**", "/kindeditor/**", "/api/**", "/actuator/**");

    }


}
